#include<bits/stdc++.h>
#define ll long long
#define L x<<1
#define R x<<1|1
#define mid (l+r>>1)
#define lc L,l,mid
#define rc R,mid+1,r
#define OK Ll<=l&&r<=Rr
#define Root 1,1,n
#define rep(x,y,z) for(int x=(y);x<=(z);x++)
#define per(x,y,z) for(int x=(y);x>=(z);x--)
#define repn(x) rep(x,1,n)
#define repm(x) rep(x,1,m)
#define pb push_back
#define e(x) for(int i=h[x],y=to[i];i;i=nxt[i],y=to[i])
#define E(x) for(auto y:p[x])
#define Pi pair<int,int>
#define ui unsigned ll
inline int read(){int s=0,w=1;char c=getchar();while(c<48||c>57) {if(c=='-') w=-1;c=getchar();}while(c>=48&&c<=57)s=(s<<1)+(s<<3)+c-48,c=getchar();return s*w;}
inline void pf(int x){if(x<0) putchar('-'),x=-x;if(x>9)pf(x/10);putchar(x%10+48);}
using namespace std;
const int N=1e5+5,M=1e7+5,inf=(1LL<<31)-1,mod=998244353;
const ll llf=1e18;
inline void add(int &a,int b){((a+=b)>=mod) and (a-=mod);}
inline int Add(int a,int b){return add(a,b),a;}
inline int mul(int a,int b){return 1LL*a*b%mod;}
inline void Mul(int &a,int b){a=mul(a,b);}
inline void red(int &a,int b){add(a,mod-b);}
inline int Red(int a,int b){return red(a,b),a;}
inline int qp(int a,int b){if(!b)return 1;int c=qp(a,b>>1);Mul(c,c);if(b&1)Mul(c,a);return c;}
inline int INV(int x){return qp(x,mod-2);}
// bool S;
int n,m,a[N],b[N],ans[N];
string s,t;
bitset<50001>dp[N],F[2],Nw;
inline void Out1(int s){
	puts("YES");
	int now=m;
	per(i,s,1){
		if(!now)break;
		if(dp[i][now])ans[now]=i,now--;
	}
	repm(i)cout <<ans[i]<<" ";
	exit(0);
}
inline void subtask1(){
	repm(i)F[b[i]][i]=1;
	Nw[1]=1,dp[1][1]=a[1]==b[1];
	rep(i,1,n-1){
		Nw|=dp[i]<<1,dp[i+1]=Nw&F[a[i+1]];
		if(a[i]!=a[i+1])Nw=dp[i]<<1;
	}
	int now=n;
	bool fl=1;
	while(1){
		if(dp[now][m])Out1(now);
		if(now==1||!fl)return puts("NO"),void();
		if(a[now]!=a[now-1])fl=0;
		now--;
	}	
}
inline void Out2(int s){
	puts("YES");
	int now=m;
	per(i,s,1){
		if(!now)break;
		if(dp[i][n-m-i+now])ans[now]=i,now--;
	}
	repm(i)cout <<ans[i]<<" ";
	exit(0);
}
inline void subtask2(){
	Nw[n-m]=1,dp[1][n-m]=a[1]==b[1];
	F[b[1]][n-m]=1;
	rep(i,1,n-1){
		F[0]=F[0]>>1,F[1]=F[1]>>1;
		if(i+1<=m)F[b[i+1]][n-m]=1;
		Nw=(Nw>>1)|dp[i],dp[i+1]=Nw&(F[a[i+1]]);
		if(a[i]!=a[i+1])Nw=dp[i];
	}
	int now=n;
	bool fl=1;
	while(1){
		if(now<m)return puts("NO"),void();
		if(dp[now][n-now])Out2(now);
		if(now==1||!fl)return puts("NO"),void();
		if(a[now]!=a[now-1])fl=0;
		now--;
	}	
}
inline void Main(){
	cin>>s>>t,n=s.length(),m=t.length();
	s='#'+s,t='#'+t;
	repn(i)a[i]=s[i]-'0';
	repn(i)b[i]=t[i]-'0';
	if(m<=50000)return subtask1(),void();
	return subtask2(),void();
}
// bool E;
signed main(){
	// cerr<<"Memory:"<<(&S-&E)/1024/1024<<"MB.\n";
	freopen("seq.in","r",stdin);
	freopen("seq.out","w",stdout);
	int T=1;
	while(T--)Main();
	return 0;
}